package com.min.generator.constant;

import cn.hutool.core.map.MapUtil;

import java.util.HashMap;
import java.util.Map;

public interface Const {

    /**
     * 数据库字段与java数据类型的映射关系
     * @author: fengt
     * @date: 2021/3/18 14:26
     **/
    Map<String, String> fieldTypeMap = MapUtil.builder(new HashMap<String, String>())
            .put("tinyint", "Integer")
            .put("smallint", "Integer")
            .put("mediumint", "Integer")
            .put("number", "Integer")
            .put("int", "Integer")
            .put("integer", "Integer")
            .put("binary_integer", "Integer")
            .put("int4", "Integer")

            .put("bigint", "Long")
            .put("int8", "Long")

            .put("char", "String")
            .put("varchar", "String")
            .put("tinytext", "String")
            .put("text", "String")
            .put("mediumtext", "String")
            .put("longtext", "String")
            .put("nvarchar", "String")
            .put("nvarchar2", "String")
            .put("clob", "String")
            .put("blob", "String")
            .put("long", "String")

            .put("float", "Float")
            .put("binary_float", "Float")
            .put("double", "Double")
            .put("binary_double", "Double")
            .put("decimal", "BigDecimal")

            .put("bit", "Boolean")
            .put("datetime", "Date")
            .put("date", "Date")
            .put("timestamp", "Date")
            .build();


    /**
     * 模板生成文件，不需要生成可以直接在此屏蔽
     * @author: fengt
     * @date: 2021/3/18 14:25
     **/
    Map<String, String> templatesMap = MapUtil.builder(new HashMap<String, String>())
            .put("entity", "template/java-entity.vm")
            .put("dao", "template/java-dao.vm")
            .put("mapper", "template/xml-mapper.vm")
            .put("service", "template/java-service.vm")
            .put("controller", "template/java-controller.vm")
            .put("sql", "template/sql-menu.vm")
            .put("vue_main", "template/vue-index.vm")
            .put("vue_add", "template/vue-add-or-update.vm")
            .put("vue_api", "template/vue-api.vm")
            .build();

}
